$inputfile = $ARGV[0];
chomp($inputfile);
$outputfile = $ARGV[1];
chomp($outputfile);
$hapmap = $ARGV[2];
chomp($hapmap);
open BUFF,$inputfile or die "can't open the file\n";
open(BUFF1,"$hapmap.tfam");
while($line = <BUFF1>)
{
	chomp($line);
	$line =~ s/\t/ /g;
	$line =~ s/\s+/ /g;
	@arr =split(" ",$line);
	
	$hash{$arr[1]} = $line;

}
open(WRBUFF,">$outputfile");
$line=<BUFF>;
	chomp($line);
	$line =~ s/\t/ /g;
        $line =~ s/\s+/ /g;
	#print $line."\n";
	@array =split(" ",$line);
	shift(@array);
	shift(@array);
	#print @array."\n";
	$flag = 1;
	for($i=0;$i<@array;$i++)
	{
		@temp = split('_',$array[$i]);
		if($flag%2 == 0)
		{
			print WRBUFF $hash{$temp[0]}."\n";
		}
		$flag++;
	}
